<template>
  <div>
    <template v-for="item in subMenu">
      <el-submenu v-if="item.children&&item.children.length>0" :index="item.value + '-' +item.label">
        <template slot="title">
          <i class="el-icon-caret-bottom"></i>{{item.label}}
        </template>  

          <dept-sub-menu :subMenu='item.children'></dept-sub-menu>
      </el-submenu>
      <el-menu-item v-else :index="item.value + '-' +item.label" >{{item.label}}
      </el-menu-item>
    </template>
  </div>
</template>

<script>
export default {
  name: 'DeptSubMenu',
  props: {
    subMenu: {
      type: Array
    }
  }
}
</script>

